﻿Public Class CViewer
    Public Shared Sub BindDonViToListBox(ByVal lsDonVi As ListBox)
        Dim ctrlDonVi As New CDonViController
        Dim data = ctrlDonVi.SelectAllRecord()
        lsDonVi.DisplayMember = "Ten"
        lsDonVi.ValueMember = "ID_DonVi"
        lsDonVi.DataSource = data
    End Sub
    Public Shared Sub BindDonViToComboBox(ByVal cbo As ComboBox)
        Dim ctrlDonVi As New CDonViController
        Dim data = ctrlDonVi.SelectAllRecord()
        cbo.DisplayMember = "Ten"
        cbo.ValueMember = "ID_DonVi"
        cbo.DataSource = data
    End Sub
    Public Shared Sub BindLoaiNSToComboBox(ByVal cbo As ComboBox)
        Dim obj As New QLyNganSachDataContext
        Dim data = obj.tblLoaiNganSaches
        cbo.DisplayMember = "Ten"
        cbo.ValueMember = "ID_LoaiNganSach"
        cbo.DataSource = data
    End Sub
End Class
